import request from '@/config/axios'

export interface TenantRechargeListVO {
  id: number
  rechargeAmount: number
  rechargeType: number
  rechargeNum: number
  attachment: string
  remark: string
  targetTenantId: number
  handleStatus: number
  operator: number
}

// 查询租户代充记录列表
export const getTenantRechargeListPage = async (params) => {
  return await request.get({ url: `/system/tenant-recharge-list/page`, params })
}

// 查询租户代充记录详情
export const getTenantRechargeList = async (id: number) => {
  return await request.get({ url: `/system/tenant-recharge-list/get?id=` + id })
}

// 查询租户代充记录列表
export const getTenantRechargeListPageByAdmin = async (params) => {
  return await request.get({ url: `/system/tenant-recharge-list/page-by-admin`, params })
}

// 查询租户代充记录详情
export const getTenantRechargeListByAdmin = async (id: number) => {
  return await request.get({ url: `/system/tenant-recharge-list/get-by-admin?id=` + id })
}

// 新增租户代充记录
export const createTenantRechargeList = async (data: TenantRechargeListVO) => {
  return await request.post({ url: `/system/tenant-recharge-list/create`, data })
}

// 审核处理
export const approveOne = async (id: number) => {
  return await request.post({ url: `/system/tenant-recharge-list/approve?id=${id}` })
}

// 修改租户代充记录
export const updateTenantRechargeList = async (data: TenantRechargeListVO) => {
  return await request.put({ url: `/system/tenant-recharge-list/update`, data })
}

// 删除租户代充记录
export const deleteTenantRechargeList = async (id: number) => {
  return await request.delete({ url: `/system/tenant-recharge-list/delete?id=` + id })
}

// 导出租户代充记录 Excel
export const exportTenantRechargeList = async (params) => {
  return await request.download({ url: `/system/tenant-recharge-list/export-excel`, params })
}
